<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title><s:text name="title" /></title>
	</head>
	<body>
		<p>
			<a href="./main.action"><s:text name="return" /> </a>
			<a href="../login/logOut.action"><s:text name="logOut" /> </a>
		</p>
		<s:actionerror/>
		<s:fielderror></s:fielderror>
		<p>
			<B><s:text name="flightInfo" /> </B>
		</p>
		<table>
			<s:form action="updateFlight" namespace="/mainService">
			<s:hidden name="flight.id"></s:hidden>
				<tr>
					<td align="right">
						<s:text name='flight.name' />
					</td>
					<td align="left">
						<s:textfield name="flight.name"/>
					</td>
				</tr>
				<tr>
					<td align="right">
						<s:text name='flight.start' />
					</td>
					<td align="left">
						<s:textfield name="flight.start"/>
					</td>
				</tr>
				<tr>
					<td align="right">
						<s:text name='flight.end' />
					</td>
					<td align="left">
						<s:textfield name="flight.end"></s:textfield>
					</td>
				</tr>
				<tr>
					<td align="right">
						<s:text name='flight.description' />
					</td>
					<td align="left">
						<s:textfield name="flight.description"></s:textfield>
					</td>
				</tr>
				<tr>
					<td align="right">
						<s:text name='flight.price' />
					</td>
					<td align="left">
						<s:textfield name="flight.price"></s:textfield>
					</td>
				</tr>
				<tr>
					<td align="right">
						<s:text name='flight.totalNum' />
					</td>
					<td align="left">
						<s:textfield name="flight.totalNum"></s:textfield>
					</td>
				</tr>
				<tr>
					<td align="right">
						<s:text name='flight.leftNum' />
					</td>
					<td align="left">
						<s:textfield name="flight.leftNum"></s:textfield>
					</td>
				</tr>
				<s:if test="'query'==method||'update'==method">
				<tr>
					<td align="right">
						<s:submit key="update"></s:submit>
					</td>
					<td align="left">
						<input type="button" value="<s:text name='delete'/>" onclick="this.form.action='/booking/mainService/deleteFlight.action';this.form.submit();">
					</td>
				</tr>
				</s:if>
				<s:else>
					<tr>
						<td align="right">
							<input type="button" value="<s:text name='insert'/>" onclick="this.form.action='/booking/mainService/insertFlight.action';this.form.submit();">
						</td>
						<td></td>
					</tr>
				</s:else>
			</s:form>
		</table>
	</body>
</html>
